// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "WorldRefLineSpline.h"
#include "entities/WorldRoad.h"
#include <unordered_map>

/**
 * An intermediate representation of inter-connecting reference lines.
 */
class FWorldRefLineGraph
{

public:

	using Ptr = std::shared_ptr<FWorldRefLineGraph>;

public:

	void Clear();

	void Add(const FWorldRoad::Ptr& road, const FWorldRefLineSpline::Ptr& spline);

	FWorldRefLineSpline::Ptr Get(const FWorldRoad::Ptr& road) const;

	FWorldRefLineSpline::Ptr operator[](const FWorldRoad::Ptr& road) const
	{ return Get(road); }

private:

	using RoadPtr = FWorldRoad::Ptr;
	using SplinePtr = FWorldRefLineSpline::Ptr;

	std::unordered_map<RoadPtr, SplinePtr>	_reflines;
};
